<template>
  <web-view :src="url"></web-view>
</template>
<script>
  import { showToast } from '../../api/wechat'
  export default {
    data() {
      return {
        url: ''
      }
    },
    mounted() {
      const { query } = this.$route
      let _url = 'http://www.youbaobao.xyz/book/#/ebook'
      if (query.fileName) {
        _url = `${_url}/${query.fileName}`
        if (query.opf) {
          _url = `${_url}?opf=${query.opf}`
        }
        if (query.navigation && query.opf) {
          _url = `${_url}&navigation=${query.navigation}`
        } else if (query.navigation) {
          _url = `${_url}?navigation=${query.navigation}`
        }
        this.url = _url
      }
      console.log(this.url, _url, query)
      showToast('点击屏幕中间显示菜单', 'none')
    }
  }
</script> 

<style lang="scss" scoped>
</style>